#!/usr/bin/env node

const fs=require('fs'),
      src=process.argv[2];

//如果没有参数打印当前目录
if(typeof src==='undefined'){
 // console.log(__dirname);
  console.log(fs.readdirSync(__dirname));
}else{
  try{
    console.log(fs.readdirSync(src));
  }catch(e){
    console.error(e.message);
  }
}
